Skip to content

[ML] AIOps: Adds Log Rate Analysis embeddable for dashboards#197943

Merged
walterra merged 46 commits into
elastic:mainfrom
walterra:ml-aiops-log-rate-analysis-embeddable-2
Nov 5, 2024
Merged

[ML] AIOps: Adds Log Rate Analysis embeddable for dashboards#197943
walterra merged 46 commits into
elastic:mainfrom
walterra:ml-aiops-log-rate-analysis-embeddable-2

Conversation

@walterra
Copy link
Copy Markdown
Contributor

@walterra walterra commented Oct 28, 2024

Summary

Part of #196660.

Follow up to #192167 (rebase/push gone wrong)

image
  • Let's users create a Log Rate Analysis panel using the "Add Panel" button when editing dashboards.
  • Retains functionality of links in results table to Discover and Pattern Analysis. 41b4337
  • Create Logs AIOps section in Add Panel menu.
  • Brushes not working with multiple panels fixed in 75ca4ca. The reason was the DualBrush component used hard coded html ids.
  • Panel now updates when data view is changed in options flyout, fixed in 2b58567.
  • When the user selects a data view without time field, we now show the same warning as used for pattern analysis and the apply button gets disabled, fixed in a01975d.
  • Pass on and use global search/filters to embeddable. 2c24dbd
  • Moving labels 26cd1a5
  • No results after time range update 632b711

Checklist

Delete any items that are not applicable to this PR.

@walterra
Copy link
Copy Markdown
Contributor Author

@jgowdyelastic @peteharverson This one is ready for another look. I had to recreate the original PR (#192167) because I messed up the commit history.

Copy link
Copy Markdown
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and overall LGTM. No longer see the error I was previously seeing with the pgbench data set. Just left a couple of minor comments on the code.

Comment thread x-pack/plugins/aiops/public/components/time_field_warning.tsx
@jgowdyelastic
Copy link
Copy Markdown
Member

When hovering over the rows in the table, the console is spammed with these warnings
image

Not a bug as such, but I think it should easy enough to change.

@walterra
Copy link
Copy Markdown
Contributor Author

walterra commented Nov 5, 2024

@jgowdyelastic great find about the aria-label, added one in c1fe2f7.

@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
aiops 584 636 +52

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
aiops 552.7KB 590.1KB +37.3KB
dataVisualizer 616.0KB 615.9KB -23.0B
ml 4.5MB 4.5MB +31.0B
transform 478.0KB 478.0KB +9.0B
total +37.4KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
aiops 7.9KB 8.4KB +438.0B
Unknown metric groups

async chunk count

id before after diff
aiops 30 34 +4

ESLint disabled line counts

id before after diff
@kbn/aiops-log-rate-analysis 0 2 +2
aiops 38 40 +2
total +4

Total ESLint disabled count

id before after diff
@kbn/aiops-log-rate-analysis 0 2 +2
aiops 38 40 +2
total +4

History

cc @walterra

Copy link
Copy Markdown
Member

@jgowdyelastic jgowdyelastic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@walterra walterra merged commit 6b77e05 into elastic:main Nov 5, 2024
@walterra walterra deleted the ml-aiops-log-rate-analysis-embeddable-2 branch November 5, 2024 14:48
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11686593167

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 5, 2024
## Summary

Follow up to elastic#192167 (rebase/push gone wrong)

<img width="1920" alt="image"
src="https://github.com/user-attachments/assets/0ee12b65-0bff-4a02-805d-adab1be2a52a">

- [x] Let's users create a Log Rate Analysis panel using the "Add Panel"
button when editing dashboards.
- [x] Retains functionality of links in results table to Discover and
Pattern Analysis.
[41b4337](elastic@41b4337)
- [x] Create `Logs AIOps` section in Add Panel menu.
- [x] Brushes not working with multiple panels fixed in
[75ca4ca](elastic@75ca4ca).
The reason was the `DualBrush` component used hard coded html ids.
- [x] Panel now updates when data view is changed in options flyout,
fixed in
[2b58567](elastic@2b58567).
- [x] When the user selects a data view without time field, we now show
the same warning as used for pattern analysis and the apply button gets
disabled, fixed in
[a01975d](elastic@a01975d).
- [x] Pass on and use global search/filters to embeddable.
[2c24dbd](elastic@2c24dbd)
- [x] Moving labels
[26cd1a5](elastic@26cd1a5)
- [x] No results after time range update
[632b711](elastic@632b711)

### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

(cherry picked from commit 6b77e05)
@kibanamachine
Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Nov 5, 2024
# Backport

This will backport the following commits from `main` to `8.x`:
- [[ML] AIOps: Log Rate Analysis embeddable
(#197943)](#197943)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Walter
Rafelsberger","email":"walter.rafelsberger@elastic.co"},"sourceCommit":{"committedDate":"2024-11-05T14:48:45Z","message":"[ML]
AIOps: Log Rate Analysis embeddable (#197943)\n\n##
Summary\r\n\r\nFollow up to #192167 (rebase/push gone wrong)\r\n\r\n<img
width=\"1920\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/0ee12b65-0bff-4a02-805d-adab1be2a52a\">\r\n\r\n-
[x] Let's users create a Log Rate Analysis panel using the \"Add
Panel\"\r\nbutton when editing dashboards.\r\n- [x] Retains
functionality of links in results table to Discover and\r\nPattern
Analysis.\r\n[41b4337](https://github.com/elastic/kibana/pull/192167/commits/41b4337f9ac15103c6b151c94cfb6b7f944aeb89)\r\n-
[x] Create `Logs AIOps` section in Add Panel menu.\r\n- [x] Brushes not
working with multiple panels fixed
in\r\n[75ca4ca](https://github.com/elastic/kibana/pull/192167/commits/75ca4cac37abda94ae7fb9d5132283e1def0b85e).\r\nThe
reason was the `DualBrush` component used hard coded html ids.\r\n- [x]
Panel now updates when data view is changed in options flyout,\r\nfixed
in\r\n[2b58567](https://github.com/elastic/kibana/pull/192167/commits/2b5856777151d3ccc5e882c895704008e575aaff).\r\n-
[x] When the user selects a data view without time field, we now
show\r\nthe same warning as used for pattern analysis and the apply
button gets\r\ndisabled, fixed
in\r\n[a01975d](https://github.com/elastic/kibana/pull/192167/commits/a01975dba7b5218ea0f094ebc5cb74cd8670131a).\r\n-
[x] Pass on and use global search/filters to
embeddable.\r\n[2c24dbd](https://github.com/elastic/kibana/pull/192167/commits/2c24dbd116ef4ae19ff58796b2c5fc4f61a86234)\r\n-
[x] Moving
labels\r\n[26cd1a5](https://github.com/elastic/kibana/pull/192167/commits/26cd1a53dfbbea34094cd840eb885a78f29d8de6)\r\n-
[x] No results after time range
update\r\n[632b711](https://github.com/elastic/kibana/pull/192167/commits/632b711ca1de77d113192649f56c5b18ae453f86)\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] This was
checked for breaking API changes and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"6b77e05586524892dc42c34d0b5b2a561cebc0ae","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":[":ml","v9.0.0","release_note:feature","Feature:ML/AIOps","backport:version","v8.17.0"],"title":"[ML]
AIOps: Log Rate Analysis
embeddable","number":197943,"url":"https://github.com/elastic/kibana/pull/197943","mergeCommit":{"message":"[ML]
AIOps: Log Rate Analysis embeddable (#197943)\n\n##
Summary\r\n\r\nFollow up to #192167 (rebase/push gone wrong)\r\n\r\n<img
width=\"1920\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/0ee12b65-0bff-4a02-805d-adab1be2a52a\">\r\n\r\n-
[x] Let's users create a Log Rate Analysis panel using the \"Add
Panel\"\r\nbutton when editing dashboards.\r\n- [x] Retains
functionality of links in results table to Discover and\r\nPattern
Analysis.\r\n[41b4337](https://github.com/elastic/kibana/pull/192167/commits/41b4337f9ac15103c6b151c94cfb6b7f944aeb89)\r\n-
[x] Create `Logs AIOps` section in Add Panel menu.\r\n- [x] Brushes not
working with multiple panels fixed
in\r\n[75ca4ca](https://github.com/elastic/kibana/pull/192167/commits/75ca4cac37abda94ae7fb9d5132283e1def0b85e).\r\nThe
reason was the `DualBrush` component used hard coded html ids.\r\n- [x]
Panel now updates when data view is changed in options flyout,\r\nfixed
in\r\n[2b58567](https://github.com/elastic/kibana/pull/192167/commits/2b5856777151d3ccc5e882c895704008e575aaff).\r\n-
[x] When the user selects a data view without time field, we now
show\r\nthe same warning as used for pattern analysis and the apply
button gets\r\ndisabled, fixed
in\r\n[a01975d](https://github.com/elastic/kibana/pull/192167/commits/a01975dba7b5218ea0f094ebc5cb74cd8670131a).\r\n-
[x] Pass on and use global search/filters to
embeddable.\r\n[2c24dbd](https://github.com/elastic/kibana/pull/192167/commits/2c24dbd116ef4ae19ff58796b2c5fc4f61a86234)\r\n-
[x] Moving
labels\r\n[26cd1a5](https://github.com/elastic/kibana/pull/192167/commits/26cd1a53dfbbea34094cd840eb885a78f29d8de6)\r\n-
[x] No results after time range
update\r\n[632b711](https://github.com/elastic/kibana/pull/192167/commits/632b711ca1de77d113192649f56c5b18ae453f86)\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] This was
checked for breaking API changes and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"6b77e05586524892dc42c34d0b5b2a561cebc0ae"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197943","number":197943,"mergeCommit":{"message":"[ML]
AIOps: Log Rate Analysis embeddable (#197943)\n\n##
Summary\r\n\r\nFollow up to #192167 (rebase/push gone wrong)\r\n\r\n<img
width=\"1920\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/0ee12b65-0bff-4a02-805d-adab1be2a52a\">\r\n\r\n-
[x] Let's users create a Log Rate Analysis panel using the \"Add
Panel\"\r\nbutton when editing dashboards.\r\n- [x] Retains
functionality of links in results table to Discover and\r\nPattern
Analysis.\r\n[41b4337](https://github.com/elastic/kibana/pull/192167/commits/41b4337f9ac15103c6b151c94cfb6b7f944aeb89)\r\n-
[x] Create `Logs AIOps` section in Add Panel menu.\r\n- [x] Brushes not
working with multiple panels fixed
in\r\n[75ca4ca](https://github.com/elastic/kibana/pull/192167/commits/75ca4cac37abda94ae7fb9d5132283e1def0b85e).\r\nThe
reason was the `DualBrush` component used hard coded html ids.\r\n- [x]
Panel now updates when data view is changed in options flyout,\r\nfixed
in\r\n[2b58567](https://github.com/elastic/kibana/pull/192167/commits/2b5856777151d3ccc5e882c895704008e575aaff).\r\n-
[x] When the user selects a data view without time field, we now
show\r\nthe same warning as used for pattern analysis and the apply
button gets\r\ndisabled, fixed
in\r\n[a01975d](https://github.com/elastic/kibana/pull/192167/commits/a01975dba7b5218ea0f094ebc5cb74cd8670131a).\r\n-
[x] Pass on and use global search/filters to
embeddable.\r\n[2c24dbd](https://github.com/elastic/kibana/pull/192167/commits/2c24dbd116ef4ae19ff58796b2c5fc4f61a86234)\r\n-
[x] Moving
labels\r\n[26cd1a5](https://github.com/elastic/kibana/pull/192167/commits/26cd1a53dfbbea34094cd840eb885a78f29d8de6)\r\n-
[x] No results after time range
update\r\n[632b711](https://github.com/elastic/kibana/pull/192167/commits/632b711ca1de77d113192649f56c5b18ae453f86)\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] This was
checked for breaking API changes and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"6b77e05586524892dc42c34d0b5b2a561cebc0ae"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Walter Rafelsberger <walter.rafelsberger@elastic.co>
@peteharverson peteharverson changed the title [ML] AIOps: Log Rate Analysis embeddable [ML] AIOps: Adds Log Rate Analysis embeddable for dashboards Nov 21, 2024
rbrtj added a commit that referenced this pull request Apr 7, 2025
)

It fixes an issue where adding the `Change Point Detection` embeddable
didn't work properly.
The bug was introduced in #197943
The main cause was the use of `<ChangePointDetectionContextProvider>`
which calls `timefilter.getActiveBounds()`. However, for
`getActiveBounds` to work, `this.isTimeRangeSelectorEnabled()` must
return true. By default, this is not the case within dashboards.
However, we do not actually need the `ChangePointDetectionContext`
inside the embeddable, so this PR removes its usage.
A functional test has been added to cover adding the Change Point
embeddable from the dashboards app. It's a very simple test that does
not verify the embeddable's functionality, but it could be improved in a
follow-up.

![image](https://github.com/user-attachments/assets/52b7f28b-87a0-423e-a923-d3e02300bf71)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
rbrtj added a commit to rbrtj/kibana that referenced this pull request Apr 7, 2025
…tic#217178)

It fixes an issue where adding the `Change Point Detection` embeddable
didn't work properly.
The bug was introduced in elastic#197943
The main cause was the use of `<ChangePointDetectionContextProvider>`
which calls `timefilter.getActiveBounds()`. However, for
`getActiveBounds` to work, `this.isTimeRangeSelectorEnabled()` must
return true. By default, this is not the case within dashboards.
However, we do not actually need the `ChangePointDetectionContext`
inside the embeddable, so this PR removes its usage.
A functional test has been added to cover adding the Change Point
embeddable from the dashboards app. It's a very simple test that does
not verify the embeddable's functionality, but it could be improved in a
follow-up.

![image](https://github.com/user-attachments/assets/52b7f28b-87a0-423e-a923-d3e02300bf71)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit d359881)

# Conflicts:
#	x-pack/plugins/aiops/public/embeddables/change_point_chart/change_point_chart_initializer.tsx
#	x-pack/test/tsconfig.json
rbrtj added a commit to rbrtj/kibana that referenced this pull request Apr 7, 2025
…tic#217178)

It fixes an issue where adding the `Change Point Detection` embeddable
didn't work properly.
The bug was introduced in elastic#197943
The main cause was the use of `<ChangePointDetectionContextProvider>`
which calls `timefilter.getActiveBounds()`. However, for
`getActiveBounds` to work, `this.isTimeRangeSelectorEnabled()` must
return true. By default, this is not the case within dashboards.
However, we do not actually need the `ChangePointDetectionContext`
inside the embeddable, so this PR removes its usage.
A functional test has been added to cover adding the Change Point
embeddable from the dashboards app. It's a very simple test that does
not verify the embeddable's functionality, but it could be improved in a
follow-up.

![image](https://github.com/user-attachments/assets/52b7f28b-87a0-423e-a923-d3e02300bf71)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit d359881)

# Conflicts:
#	x-pack/platform/plugins/shared/aiops/public/embeddables/change_point_chart/change_point_chart_initializer.tsx
#	x-pack/test/tsconfig.json
rbrtj added a commit to rbrtj/kibana that referenced this pull request Apr 7, 2025
…tic#217178)

It fixes an issue where adding the `Change Point Detection` embeddable
didn't work properly.
The bug was introduced in elastic#197943
The main cause was the use of `<ChangePointDetectionContextProvider>`
which calls `timefilter.getActiveBounds()`. However, for
`getActiveBounds` to work, `this.isTimeRangeSelectorEnabled()` must
return true. By default, this is not the case within dashboards.
However, we do not actually need the `ChangePointDetectionContext`
inside the embeddable, so this PR removes its usage.
A functional test has been added to cover adding the Change Point
embeddable from the dashboards app. It's a very simple test that does
not verify the embeddable's functionality, but it could be improved in a
follow-up.

![image](https://github.com/user-attachments/assets/52b7f28b-87a0-423e-a923-d3e02300bf71)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit d359881)

# Conflicts:
#	x-pack/platform/plugins/shared/aiops/public/embeddables/change_point_chart/change_point_chart_initializer.tsx
#	x-pack/test/tsconfig.json
rbrtj added a commit to rbrtj/kibana that referenced this pull request Apr 7, 2025
…tic#217178)

It fixes an issue where adding the `Change Point Detection` embeddable
didn't work properly.
The bug was introduced in elastic#197943
The main cause was the use of `<ChangePointDetectionContextProvider>`
which calls `timefilter.getActiveBounds()`. However, for
`getActiveBounds` to work, `this.isTimeRangeSelectorEnabled()` must
return true. By default, this is not the case within dashboards.
However, we do not actually need the `ChangePointDetectionContext`
inside the embeddable, so this PR removes its usage.
A functional test has been added to cover adding the Change Point
embeddable from the dashboards app. It's a very simple test that does
not verify the embeddable's functionality, but it could be improved in a
follow-up.

![image](https://github.com/user-attachments/assets/52b7f28b-87a0-423e-a923-d3e02300bf71)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit d359881)

# Conflicts:
#	x-pack/test/tsconfig.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels Feature:ML/AIOps ML AIOps features: Change Point Detection, Log Pattern Analysis, Log Rate Analysis :ml release_note:feature Makes this part of the condensed release notes v8.17.0 v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants